﻿<UserControl x:Class="Calculator.Views.Calculator"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:viewmodels="clr-namespace:Calculator.ViewModels"
             mc:Ignorable="d" 
             d:DesignHeight="300" d:DesignWidth="300">
    <UserControl.DataContext>
        <viewmodels:ViewModelCalculator/>
    </UserControl.DataContext>
    <UserControl.Resources>
    <Style x:Key="CalculatorStyle" TargetType="Button">
        <Setter Property="Width" Value="30"/>
        </Style>
    </UserControl.Resources>
    
    <StackPanel>
        <StackPanel Orientation="Horizontal">
            <TextBox Name="FirstNumber" Width="40" Margin="0,0,10,0"/>
            <TextBox Name="SecondNumber" Width="40"/>
        </StackPanel>
        <StackPanel Orientation="Horizontal">
            <Button Style="{StaticResource CalculatorStyle}" Content="+" Click="ButtonSum_Click"/>
            <Button Style="{StaticResource CalculatorStyle}" Content="-" Click="ButtonSubtract_Click"/>
            <Button Style="{StaticResource CalculatorStyle}" Content="*" Click="ButtonMultiply_Click"/>
            <Button Style="{StaticResource CalculatorStyle}" Content="/" Click="ButtonDivide_Click"/>
        </StackPanel>
        <StackPanel Orientation="Horizontal">
            <Button Style="{StaticResource CalculatorStyle}" Content="Sqrt" Click="ButtonSqrt_Click"/>
            <Button Style="{StaticResource CalculatorStyle}" Content="P" Click="ButtonPower_Click"/>
            <Button Style="{StaticResource CalculatorStyle}" Content="Log" Click="ButtonLogarithm_Click"/>
        </StackPanel>
        <StackPanel Orientation="Horizontal">
            <Label Content="="/>
            <TextBlock Name="Result"/>
        </StackPanel>
    </StackPanel>
</UserControl>
